package edu.uis.project.frankszoo.model.card;

import java.util.List;

/**
 * This abstract class is the super class for all the cards used in the Frank's Zoo game
 * 
 */
public abstract class Card {

	protected List<Class> higherRankedCards; // Indicates the list containing cards that outrank this card
	protected List<Class> lowerRankedCards; // Indicates the list containing cards that are outranked by this card
	public static int maxCardsPerDeck = 0; // The maximum number of cards of this card allowed
	protected boolean playAlone; // Whether this card can be played by itself

	/**
	 * Uses the higherRankedCards list to verify whether the incoming card outranks this card
	 * 
	 * @param card
	 * @return boolean value
	 */
	public boolean isOutrankedBy(Card card) {
		if (higherRankedCards.contains(card.getClass())) {
			return true;
		} else {
			return false;
		}
	}

	/**
	 * Uses the lowerRankedCards list to verify whether the incoming card can be outranked by this card
	 * 
	 * @param card
	 * @return boolean value
	 */
	public boolean canOutrank(Card card) {
		if (lowerRankedCards.contains(card.getClass())) {
			return true;
		} else {
			return false;
		}
	}

	/**
	 * Returns the playAlone value that represents whether the current card can be played alone as a single card.
	 * 
	 * @return playAlone
	 */
	public boolean canPlayAlone() {
		return playAlone;
	}

}
